﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace MVCMongo
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
                        routes.MapRoute(
"SubmitUrl", // Route name
"SubmitUrl", // URL with parameters
new { controller = "Submit", action = "SubmitUrl", id = UrlParameter.Optional }
                // Parameter defaults
);
            routes.MapRoute(
"Submit", // Route name
"Submit", // URL with parameters
new { controller = "Submit", action = "Index", id = UrlParameter.Optional }
                // Parameter defaults
);

            routes.MapRoute(
"CategoryFeeds", // Route name
"b/{id}/{categoryname}", // URL with parameters
new { controller = "Home", action = "Category", id = UrlParameter.Optional }
                // Parameter defaults
);


            routes.MapRoute(
"TagDetails", // Route name
"btag/{id}/{tag}", // URL with parameters
new { controller = "Home", action = "TagDetails", id = UrlParameter.Optional }
                // Parameter defaults
);


            routes.MapRoute(
"Tags", // Route name
"btag", // URL with parameters
new { controller = "Home", action = "Tags", id = UrlParameter.Optional }
                // Parameter defaults
);


            routes.MapRoute(
  "SourceDetails", // Route name
  "bsource/{id}/{source}", // URL with parameters
  new { controller = "Home", action = "SourceDetails", id = UrlParameter.Optional }
                // Parameter defaults
  );

            routes.MapRoute(
"Sources", // Route name
"sources", // URL with parameters
new { controller = "Home", action = "Sources", id = UrlParameter.Optional }
                // Parameter defaults
);


            routes.MapRoute(
        "AllFeed", // Route name
        "AllFeeds", // URL with parameters
        new { controller = "Home", action = "AllFeeds", id = UrlParameter.Optional }
                // Parameter defaults
        );



            routes.MapRoute(
          "ViewFeed", // Route name
          "Feed/{id}/{title}", // URL with parameters
          new { controller = "Home", action = "FeedComment", id = UrlParameter.Optional }
                // Parameter defaults
          );

            routes.MapRoute(
          "Profile", // Route name
          "{userName}", // URL with parameters
          new { controller = "Profile", action = "Index", id = UrlParameter.Optional }
                // Parameter defaults
          );

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );

        }
    }
}